package com.flying.ouyu.controller;

import java.util.ArrayList;

public class BaseController {
	
	protected ArrayList<IObserver> observerList = new ArrayList<IObserver>();
	
	protected BaseController()
	{
		
	}
	
	public void registerObserver(IObserver observer)
	{
		synchronized(observerList)
		{
			observerList.add(observer);
		}
	}
	
	public void unregisterObserver(IObserver observer)
	{
		synchronized(observerList)
		{
			if (observerList.contains(observer))
			{
				observerList.remove(observer);
			}
		}
	}
}
